<?php

/*
 * gpa_new Description
 * date 17 Feb 10
 * time 13:47:12
 * @$package
 * @name view_image_html
 * @filesource view_image_html.php
 * @author Hanny Setiawan
 */

?>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<html>
<head>
<title><?php echo $page_title; ?></title>
<script src="<?php echo getJsUrl(); ?>jquery.js" type="text/javascript"></script>
<link rel="stylesheet" href="<?php echo getCssUrl(); ?>gallery/gallery.css" type="text/css">
<link rel="stylesheet" href="<?php echo getCssUrl(); ?>home/home.css" type="text/css">

<!-- start jQuery menu -->
<link type="text/css" href="<?php echo getCssUrl(); ?>menu_apycom/menu.css" rel="stylesheet" />
<script type="text/javascript" src="<?php echo getJsUrl(); ?>menu_apycom/menu.js"></script>
<!-- end of jQuery menu -->

<script src="<?php echo getJsUrl(); ?>prettyComments/prettyComments.js" type="text/javascript"></script>

<script type="text/javascript">
    (function($){
        $(function(){
            $("#comment-field")
            .focus(function(){
                if($(this).val()=='Place your comment here...') $(this).val('');
            })
            .blur(function(){
                if($(this).val()=='') $(this).val('Place your comment here...');
            })
            .prettyComments();

            $("#comment-submit").click(function(e){
                e.preventDefault();
                e.stopPropagation();

                if($("#comment-field").val().length && $("#comment-field").val()!='Place your comment here...') {
                    $.post("<?php echo getAppUrl('gallery','comment'); ?>?iid=<?php echo $detail['image_id'];?>", $("#comment-field").serialize(), function(d,s){if(s=="success"){window.location=window.location;}});
                }
            });

            $(".good-comment a").click(function(e){
                e.preventDefault();
                e.stopPropagation();

                var href = $(this).attr('href');

                $.post(
                    "<?php echo getAppUrl('comment','good_comment'); ?>",
                    {"cid":href},
                    function(d,s){
                        if(s=="success"){
                            alert(d);
                            window.location = window.location;
                        }
                    }
                );
            });
        });
    })(jQuery);
</script>

</head>
<body>

<div id="root">
    <div id="Table_01">
        <div id="index">
    	<div id="leftTop">
            <img class="logo" src="<?php echo getImgUrl(); ?>/home/logogpa.png" width="310" height="90" alt="Logo GPA">
        </div>
  		<div id="rightTop">
        	<div id="rTop">
            	<div class="login">
                	<div class="login-text">
                		<?php echo $usermenus; ?>
                    </div>
                    <div class="login-box">
                    	<input name="login-field" type="text" maxlength="30">
                    </div>
                </div>
            </div>
        	<div id="rBottom">
                    <div id="menu">
                            <?php echo $mainmenus; ?>
                    </div>
        	</div>
    	</div>
	</div>
	<div id="index002">
            <div class="content">
                <h3>Photo Galleries</h3>
                <h4>Title : "<span style="color: #aaa; font-weight: normal;"><?php echo $detail['title'];?>"</span></h4>
                <ul class="gallery-detail">
                    <li>
                        <img src="<?php echo $detail['href'];?>" alt="<?php echo $detail['title'];?>" title="<?php echo $detail['title'];?>" style="border: 4px solid #000;"/>
                <!--<div class="fav-sign">
                    <a href="#">
                        <img src="<?php echo getImgUrl(); ?>fav.png" alt="My Favourites Picture">

                        <div class="fav-label">
                            My Favourites Picture
                        </div>
                    </a>
                </div>-->
                <div id="comments">
                    <!--<div class="user-photo">
                        <img src="../User/images/hanny.setiawan.jpg">
                    </div>-->
                    <div class="comment-section">
                        <div class="comment-label">Comments :</div>
                        
                        <div class="comment-nubs">
                            <img src="<?php echo getImgUrl(); ?>nubs.png" alt="nubs">
                        </div>

                        <div class="comment-area">
                            <textarea id="comment-field" name="comment-field" rows="3" cols="30">Place your comment here...</textarea>
                        </div>
                        <div class="comment-button">
                            <input type="submit" id="comment-submit" value="Comment"/>
                        </div>
                    </div>
                </div>
                 <div id="other-comments">
                    <!--<div class="user-photo">
                        <img src="../User/images/hanny.setiawan.jpg">
                    </div>-->
                    <div class="other-comment-section">
                        <div class="other-comment-area">
                            <?php if($j=count($detail['user_comments'])) { ?>
                                <?php for($i=0;$i<$j;$i++) { ?>
                                <div class="other-comment-detail">
                                    <div class="other-comment-detail-comment">
                                        <?php if($user_image && !$detail['user_comments'][$i]['is_user_comment'] && !$detail['user_comments'][$i]['is_recommended_comment']): ?>
                                        <div id="good_comment_<?php echo $detail['user_comments'][$i]['comment_id']; ?>" class="good-comment">
                                            <a href="#good_comment_<?php echo $detail['user_comments'][$i]['comment_id']; ?>">
                                                <img src="<?php echo getHttpUrl(); ?>/images/gg-sign.png" class="gg-sign" alt="Good Comment!"/>
                                            </a>
                                        </div>
                                        <?php endif; ?>
                                        <div class="other-comment-label">
                                            Comment #<?php echo $detail['user_comments'][$i]['comment_id']; ?>
                                        </div>
                                        <div class="other-comment-comment">
                                            <span class="<?php echo($detail['user_comments'][$i]['is_user_comment']?'user-comment':''); ?>"><?php echo $detail['user_comments'][$i]['comment']; ?></span>
                                            <p style="font-size: 8px; color: #fff; text-align: right; padding: 0; margin: 5px 0 0 0;">
                                                <?php echo $detail['time_stamp'];?>
                                            </p>
                                        </div>
                                    </div>
                                </div>
                                <?php } ?>
                            <?php } else { ?>
                            <p style="margin: 10px">No Comment Yet</p>
                            <?php } ?>
                        </div>
                    </div>
                </div>
            </li>
	</ul>
            </div>
	</div>
    </div>
</div>
    	<a id="thanks" href="http://apycom.com/">Apycom jQuery Menus</a>
       
</body>
</html>